#include <stdio.h>
#include <stdlib.h>
#include <csp_spu.h>
#include <csp_debug.h>


int fact(int n){
	if(0 == n){
		return 1;
	}
	csp_yield();
	return n * fact(n-1);
}

int Run(){
	int res = 0;
	//PRINTF_FOR_TESTING("fact_yield_task start\n");
	
	res = fact(5);
	ASSERT(120 == res);

	PRINTF_FOR_TESTING("fact_yield_task end: 120=%i\n", res);
	return res + 12;
}

